- title 'Company settings'

- content_for :head do
  = javascript_include_tag 'validation', 'company'

- content_for :title do
  = link_to "← Back to account dashboard", account_path(current_account), :class => 'back'
  %h1 Company settings

- if is_account_admin?
  - content_for :side_panel do
    .side-panel
      %h2 Manage users
      Manage the users who have access to this company and it's backlogs
      .button-container
        = link_to 'Manage company users', account_company_users_path(current_account, @company), :class => 'button'

%p
  The settings for this company will automatically be used for new backlogs for this company.

= form_for(@company, :url => account_company_path(current_account, @company)) do |f|
  - unless @company.errors.blank?
    .form_errors
      We were unable to update the company defaults.  Please correct the following fields first:
      %ul
        - @company.errors.full_messages.each do |error|
          %li
            = error

  = f.label :name, "Company Name"
  .input-row
    = f.text_field :name
    - if @company.id.present?
      = hidden_field_tag :company_name_original, @company.name_was

  = render :partial => '/_shared/backlog_preferences', :locals => { :context => @company, :namespace => 'company', :f => f }

  %br/
  = f.submit "Update company"
  = link_to "cancel", account_path(@company.account)
